package com.wltjack.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wltjack.dao.mapper.UserMapper;
import com.wltjack.dao.model.UserEntity;
import com.wltjack.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public List<UserEntity> selectAll(UserEntity userEntity) {
        return userMapper.selectAll(userEntity);
    }

    @Override
    public PageInfo<UserEntity> getPage(int pageNo, int pageSize) {
        // 设置分页参数
        PageHelper.startPage(pageNo,pageSize);
        List<UserEntity> userEntityList = userMapper.selectAll(new UserEntity());
        return new PageInfo(userEntityList);
    }
}
